using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Finance
{
  [DefaultClassOptions]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("应收帐")]
  [DevExpress.Persistent.Base.NavigationItemAttribute("财务管理")]
  public partial class AccountReceivable : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private System.String _gargoTeminalTelephone;
    private Ascent.QiPei.Module.BusinessObjects.Base.GargoTeminal _gargoTeminal;
    private Ascent.QiPei.Module.BusinessObjects.Base.Customer _customer;
    private System.String _remark;
    private System.Single _debtAmount;
    private System.Single _ReceivabledAmount;
    private System.Single _ReceivableAmount;
    private System.String _customerTelphone;
    private System.String _aRCCode;
    public AccountReceivable(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("单号")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String ARCCode
    {
      get
      {
        return _aRCCode;
      }
      set
      {
        SetPropertyValue("ARCCode", ref _aRCCode, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("客户")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Customer Customer
    {
      get
      {
        return _customer;
      }
      set
      {
          SetPropertyValue("Customer", ref _customer, value);
        //if (_customer == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Customer prevCustomer = _customer;
        //_customer = value;
        //if (IsLoading)
        //  return;
        //if (prevCustomer != null && prevCustomer.AccountReceivable == this)
        //  prevCustomer.AccountReceivable = null;
        //if (_customer != null)
        //  _customer.AccountReceivable = this;
        //OnChanged("Customer");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("客户电话")]
    public System.String CustomerTelphone
    {
      get
      {
        return _customerTelphone;
      }
      set
      {
        SetPropertyValue("CustomerTelphone", ref _customerTelphone, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("货运站")]
    public Ascent.QiPei.Module.BusinessObjects.Base.GargoTeminal GargoTeminal
    {
      get
      {
        return _gargoTeminal;
      }
      set
      {
          SetPropertyValue("GargoTeminal", ref _gargoTeminal, value);
        //if (_gargoTeminal == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.GargoTeminal prevGargoTeminal = _gargoTeminal;
        //_gargoTeminal = value;
        //if (IsLoading)
        //  return;
        //if (prevGargoTeminal != null && prevGargoTeminal.AccountReceivable == this)
        //  prevGargoTeminal.AccountReceivable = null;
        //if (_gargoTeminal != null)
        //  _gargoTeminal.AccountReceivable = this;
        //OnChanged("GargoTeminal");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("货运站电话")]
    public System.String GargoTeminalTelephone
    {
      get
      {
        return _gargoTeminalTelephone;
      }
      set
      {
        SetPropertyValue("GargoTeminalTelephone", ref _gargoTeminalTelephone, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("应收金额")]
    public System.Single ReceivableAmount
    {
      get
      {
        return _ReceivableAmount;
      }
      set
      {
        SetPropertyValue("ReceivableAmount", ref _ReceivableAmount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("已付金额")]
    public System.Single ReceivabledAmount
    {
      get
      {
        return _ReceivabledAmount;
      }
      set
      {
        SetPropertyValue("ReceivabledAmount", ref _ReceivabledAmount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("欠款金额")]
    public System.Single DebtAmount
    {
      get
      {
        return _debtAmount;
      }
      set
      {
        SetPropertyValue("DebtAmount", ref _debtAmount, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("AccountReceivableItemses-AccountReceivable")]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("明细")]
    public XPCollection<Ascent.QiPei.Module.BusinessObjects.Finance.AccountReceivableItems> AccountReceivableItemses
    {
      get
      {
        return GetCollection<Ascent.QiPei.Module.BusinessObjects.Finance.AccountReceivableItems>("AccountReceivableItemses");
      }
    }
  }
}
